import Vue from 'vue'
import Router from 'vue-router'
import main from '../components/home/main.vue'
import test from '../components/test.vue'
import content from '../components/home/content.vue'
// import login from '../components/user/login.vue'
import register from '../components/user/register.vue'
import hall from '../components/hall/index.vue'
import hallChildren from './hall' // 购彩大厅
import active from '../components/active'
import message from '../components/active/message.vue'
import charts from '../components/active/charts.vue'
import play from '../components/play'
import news from '../components/news'
import detail from '../components/news/detail'
// 用户后台
import back from '../components/back/home'
import backChildren from './back'

import error from '../components/home/error.vue'
import problem from '../components/active/problem.vue'

import playMany from './play'
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: '主页',
      component: main,
      children: [
        {
          path: '/',
          name: '默认主页',
          component: content
        },
        {
          path: '/content',
          name: '主页内容',
          component: content
        },
        {
          path: '/hall',
          name: '购彩大厅',
          component: hall,
          children: hallChildren
        },
        {
          path: '/active',
          name: '优惠活动',
          component: active
        },
        {
          path: '/message',
          name: '开奖公告',
          component: message
        },
        {
          path: '/charts',
          name: '走势图标',
          component: charts
        },
        {
          path: '/login',
          name: '登录页面',
          component: resolve => require(['../components/user/login.vue'], resolve)
        },
        {
          path: '/register',
          name: '注册页面',
          component: register
        },
        {
          path: '/play',
          name: '玩法',
          component: play,
          children: playMany
        },
        {
          path: '/news',
          name: '彩票资讯',
          component: news
        },
        {
          path: '/news/detail/:id',
          name: '资讯详情',
          component: detail
        },
        {
          path: '/problem',
          name: '问题',
          component: problem
        }
      ]
    },
    {
      path: '/back',
      name: '用户后台',
      component: back,
      children: backChildren
    },
    {
      path: '/test',
      name: '测试页面',
      component: test
    },
    {
      path: '/error',
      name: '错误页面',
      component: error
    }
  ]
})
